﻿using Microsoft.Extensions.DependencyInjection;
using Syspetro.Core.HttpService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Syspetro.DepConsul
{
    public static class ServiceCollection
    {
        public static IServiceCollection AddConsul<T>(this IServiceCollection services) where T : AbstractConsulDispatcher
        {
            services.AddHttpClient();
            services.AddTransient<ConsulClientHelper>();
            services.AddTransient<HttpHelper>();
            services.AddTransient<AbstractConsulDispatcher, T>();
            return services;
        }
    }
}
